Skip to content

Forward colors option to PHPUnit, even when it matches the default option value.#1103

Draft
mickverm wants to merge 1 commit into
paratestphp:7.xfrom
mickverm:forward-colors-option-to-phpunit
Draft

Forward colors option to PHPUnit, even when it matches the default option value.#1103
mickverm wants to merge 1 commit into
paratestphp:7.xfrom
mickverm:forward-colors-option-to-phpunit

Conversation

@mickverm

Copy link
Copy Markdown

Fixes #1101

@Slamdunk Slamdunk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you: could you please add a test, so we can be sure the bug doesn't get reintroduced in the future?

@mickverm mickverm marked this pull request as draft April 29, 2026 08:20
@mickverm

Copy link
Copy Markdown
Author

Yes, I was still working on it 😛

@mickverm mickverm force-pushed the forward-colors-option-to-phpunit branch from dc63542 to 1120c12 Compare April 29, 2026 08:49
Comment thread src/Options.php
unset($options['functional']);

assert(array_key_exists('colors', $options));
if ($options['colors'] === Configuration::COLOR_DEFAULT) {

@mickverm mickverm Apr 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered that when I simply removed the 'if', the option fell back to the default nonetheless (when not passed as an argument) because of what was on line 700. Which meant it fell back to --colors=never, which would override the colors="true" configured in phpunit.dist.xml.

@mickverm

Copy link
Copy Markdown
Author

@Slamdunk could you point me in the direction of a related test? I'm having trouble figuring out how I could properly test this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

--colors=never is not forwarded to PHPUnit

2 participants